<?php
// main function
include("../../type/model.php");
include("../view/basefunction.php");

$type_list = get_type_list('product');
$body_html = represent_form($type_list);

include("../template/layout.php");

// view
function represent_form($type_list)
{
	$form_html =
"<script charset='utf-8' src='../editor/kindeditor.js'></script>
<script>
	KE.show({
		id : 'content',
		cssPath : './index.css',
		afterCreate : function(id) {
			KE.event.ctrl(document, 13, function() {
				KE.sync(id);
				document.forms['example'].submit();
			});
			KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
				KE.sync(id);
				document.forms['example'].submit();
			});
		}
	});
</script>
<form action='./publish_post.php' method='post' enctype='multipart/form-data'>
<input type='hidden' name='MAX_FILE_SIZE' value='1000000' />
新闻标题：<input type='text' name='title'/><br />
所属分类：" . represent_type_list($type_list, NULL, "news") . "<br />
内容：<br />
<textarea id='content' name='content' style='width:700px;height:300px;visibility:hidden;'>
</textarea>
<input type='submit' value='发布' />
</form>";
	return $form_html;
}
?>
